//
//  User.swift
//  WeiBo
//
//  Created by Tony on 2018/1/22.
//  Copyright © 2018年 Tony. All rights reserved.
//

import UIKit

class User: NSObject {

    // 属性
    var profile_image_url : String?
    var screen_name : String?
    var verified_type : Int = 0 /*{
        didSet {
            switch verified_type {
            case 0:
                verified_image = UIImage.init(named: "avatar_vip")
            case 2,3,5:
                verified_image = UIImage.init(named: "avatar_grassroot")
            case 220:
                verified_image = UIImage.init(named: "avatar_enterprise_vip")
            default:
                verified_image = nil
            }
        }
    }*/
    var mbrank : Int = 0 /*{
        didSet {
            if mbrank > 0 && mbrank <= 6 {
                vip_image = UIImage.init(named: "common_icon_membership_level\(mbrank)")
            }
        }
    }*/
    
    // 数据处理
    /*
    var verified_image : UIImage?
    var vip_image : UIImage?
    */
    
    // init
    init(dict:[String : Any]) {
        super.init()
        
        setValuesForKeys(dict)
    }
    override func setValue(_ value: Any?, forUndefinedKey key: String) {}
    
    // description
    override var description: String {
        return dictionaryWithValues(forKeys: ["profile_image_url","screen_name","verified_type","mbrank"]).description
    }
    
}
